package com.cn.zengzeng.spbzengzeng.exception;


import com.cn.zengzeng.spbzengzeng.enums.CodeAndMsgEnum;
import com.cn.zengzeng.spbzengzeng.enums.ErrorCode;
import lombok.Data;

/**
 * @Description: 自定义异常
 * @Author: zhangzengzeng
 * @Date: 2021/7/8 17:43
 */
public class MyUnDefindException extends RuntimeException {

    private final String code ;
    private final String msg ;


    public MyUnDefindException (String code,String msg) {
        this.code = code;
        this.msg = msg;
    }

    public MyUnDefindException (String message,String code,String msg) {
        super(message);
        this.code = code;
        this.msg = msg;
    }

    public MyUnDefindException (String message,Throwable cause,String code,String msg) {
        super(message,cause);
        this.code = code;
        this.msg = msg;
    }

    public MyUnDefindException (Throwable cause,String code,String msg) {
        super(cause);
        this.code = code;
        this.msg = msg;
    }

    public MyUnDefindException (String message,Throwable cause,boolean enableSuppression,boolean writableStackTrace,String code,String msg) {
        super(message,cause,enableSuppression,writableStackTrace);
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String toString () {
        return "MyUnDefindException{" + "code='" + code + '\'' + ", msg='" + msg + '\'' + '}';
    }

    public String getCode () {
        return code;
    }

    public String getMsg () {
        return msg;
    }
}
